# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-cx_freeze
_pkgname=cx_Freeze
pkgver=6.11.1
pkgrel=0
pkgdesc="Set of utilities for freezing Python scripts into executables"
url="https://github.com/marcelotduarte/cx_Freeze"
arch="all !ppc64le"
license="PSF"
depends="patchelf"
makedepends="py3-setuptools python3-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/marcelotduarte/cx_Freeze/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

prepare() {
	default_prepare

	# fix permissions, which are 0700 for files and 2700 for directories
	find "$builddir" -type f -exec chmod 0644 {} \;
	find "$builddir" -type d -exec chmod 0755 {} \;

	sed -i '/patchelf/c\#' "$builddir/setup.cfg"
	sed -i 's/DESTSHARED/DESTLIB/' "$builddir/cx_Freeze/freezer.py"
}

build() {
	python3 setup.py build
}

check() {
	python3 setup.py check
}

package() {
	python3 setup.py install --skip-build --prefix=/usr --root="$pkgdir"
}

sha512sums="
37586365a901800fcd18ab6e3b0de9e3e9980c8d8b8b61aa1eddf0d01dc50b53cb1ffc77070f5a5ad40c9b7a020b09ced51d38f53688129b2444abe020a75237  py3-cx_freeze-6.11.1.tar.gz
"
